﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<CRM.Database.Model.ControllersAndActions>>" %>

<%@ Import Namespace="CRM.Resourses" %>

<% Html.DevExpress().GridView(settings =>
                                    {
                                        settings.Name = "gdControllersAndActions";
                                        settings.KeyFieldName = "IdControllersAndAction";
                                        settings.CallbackRouteValues =
                                            new { Controller = "Dictionaries", Action = "ControllersAndActionsPartial" };
                                        settings.SettingsPager.PageSize = 20;
                                       
                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.ControllersAndActionsController;
                                            column.FieldName = "Controller";
                                        });

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.ControllersAndActionsAction;
                                            column.FieldName = "Action";
                                        });

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.ControllersAndActionsDescription;
                                            column.FieldName = "Description";
                                        });

                                        //
                                        //Добавление редактирования
                                        //
                                        settings.CommandColumn.Visible = true;
                                        //settings.CommandColumn.NewButton.Visible = true;
                                        settings.CommandColumn.DeleteButton.Visible = true;
                                        settings.CommandColumn.EditButton.Visible = true;
                                        settings.SettingsBehavior.ConfirmDelete = true;
                                        settings.Settings.ShowFilterRow = true;
                                        settings.SettingsEditing.UpdateRowRouteValues = new { Controller = "Dictionaries", Action = "ControllersAndActionsPartialUpdate" };
                                        //settings.SettingsEditing.AddNewRowRouteValues = new { Controller = "Dictionaries", Action = "ControllersAndActionsPartialAdd" };
                                        settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "Dictionaries", Action = "ControllersAndActionsPartialDelete" };
                                        settings.SettingsEditing.Mode = GridViewEditingMode.EditFormAndDisplayRow;
                                        settings.Width = Unit.Percentage(100);
                                    })
       .Bind(Model).GetHtml();
%>


